﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Phoenix.AppCode.Entities;
using Phoenix.AppCode.Data;
using System.Data;

namespace Phoenix.AppCode.Bussiness
{
    public class PortService
    {
        public PortService() 
        {
            //
            // TODO: Add constructor logic here
            //    
        }
        public static DataTable PortList(Port port)
        {
            PortDAO portDAO = new PortDAO();
            return portDAO.PortList(port);
        }

        /// <summary>
        /// Create 
        /// </summary>
        /// <param name="port"></param>
        public static void Create(Port port)
        {
            PortDAO portDAO = new PortDAO();
            portDAO.Create(port);
        }

        /// <summary>
        /// Edit
        /// </summary>
        /// <param name="port"></param>
        public static void Edit(Port port)
        {
            PortDAO portDAO = new PortDAO();
            portDAO.Edit(port);
        }

        /// <summary>
        /// On/Off
        /// </summary>
        /// <param name="port"></param>
        public static void OnOff(Port port)
        {
            PortDAO portDAO = new PortDAO();
            portDAO.OnOff(port);
        }

        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="port"></param>
        public static void Delete(Port port)
        {
            PortDAO portDAO = new PortDAO();
            portDAO.Delete(port);
        }

        /// <summary>
        /// Show all
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        public static DataTable PortList() {
            PortDAO portDAO = new PortDAO();
            return portDAO.PortList();
        }
        
        /// <summary>
        /// Show data by ID
        /// </summary>
        /// <param name="idport"></param>
        /// <returns></returns>
        public static DataTable PortList_GetByID(int idport)
        {
            PortDAO portDAO = new PortDAO();
            return portDAO.PortList_GetByID(idport);
        }

        /// <summary>
        /// Get ID to edit or delete 
        /// </summary>
        /// <param name="idport"></param>
        /// <returns></returns>
        public static Port GetPortByID(int idport)
        {
            PortDAO portDAO = new PortDAO();
            return portDAO.GetPortByID(idport);
        }
    }
}